package com.live.common;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.live.activity.R;

public class LiveCommon {

	/**
	 * 设置头部标题及按钮文字
	 * 
	 * @param view
	 * @param titleValue
	 * @param buttonValue
	 */
	public static void setHead(final Context context, View view, int titleValue, int buttonValue) {
		Button funcBtn = (Button) view.findViewById(R.id.headFuncBtn);
		funcBtn.setText(buttonValue);

		TextView title = (TextView) view.findViewById(R.id.headTitle);
		title.setText(titleValue);

		ImageView backBtn = (ImageView) view.findViewById(R.id.headBackBtn);
		backBtn.setOnClickListener(new ImageView.OnClickListener() {
			@Override
			public void onClick(View v) {
				((Activity) context).finish();
			}
		});
	}
}
